package com.qjq.glasses_shopping.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qjq.glasses_shopping.pojo.Goods;
import com.qjq.glasses_shopping.pojo.GoodsDesc;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@Mapper
public interface GoodsMapper extends BaseMapper<Goods> {
    //添加规格项
    void addGoodsSpecificationOption(@Param("gid") Long gid, @Param("optionId") Long optionId);
    //根据商品id删除规格项关联表
    void deleteGoodsSpecificationOption(Long gid);
    //上/下架商品
    void putAway(@Param("id") Long id, @Param("isMarketable") Boolean isMarketable);
    //根据id查询商品信息
    Goods findById(Long id);
    // 查询所有商品详情
    List<GoodsDesc> findAll();
    // 根据商品id查询商品详情全部
    GoodsDesc findDesc(Long id);
    // 根据名称模糊查询商品查询商品名称
    List<GoodsDesc> autosuggest(@Param("goodsName") String goodsName);



}
